package com.opensource.afuluo.valve.stage.metric;

import cn.hutool.core.lang.Assert;
import cn.hutool.http.HttpResponse;
import com.opensource.afuluo.annotation.AtomicValve;
import com.opensource.afuluo.ctx.Context;
import com.opensource.afuluo.valve.Valve;

@AtomicValve("METRIC_HTTP_RESPONSE")
public class HttpResponseMetricValve implements Valve {
    @Override
    public void fire(Context ctx) {
        HttpResponse response = ctx.getConfig(HttpResponse.class);
        Assert.isTrue(response.isOk());
    }
}
